home *** CD-ROM | disk | FTP | other *** search
- This is the documentation file for an archive also holding Turbo Pascal 5.5
- source for four object-oriented units that illustrate and apply TFDD's --
- text file device drivers:
- tfdd.pas, a generic TFDD class meant only for inheritance. but suitable
- for any TFDD;
- kbdEdit.pas, a tfdd descendant that implements a decent line editor for
- Read's and Readln's (like the editor the TP IDE uses for option
- windows)
- strWrite.pas, a second tfdd descendant that simply allows writes to go
- to a string instead of to any output; the string can then be
- retrieved later
- writAttr.pas, a third tfdd descendant that allows display attributes to
- be specified right in the middle of a write.
-
- The point of using text file device drivers to do this is that a TFDD is simply
- invoked as a file variable whithin any Read, Readln, Write or Writeln, so:
- 1) you can still use the special flexibility of these Pascal commands,
- which can't be reproduced in normal in procedures;
- 2) pre-existing code is extremely easy to convert;
- 3) for quick work, no new procedures have to be learned -- you simply
- add the proper unit to the Uses clause, and call the proper file
- var.
-
- Notes:
- Tfdd.pas makes use of the User Data field in a text record to pass the
- address of Self to the various driver functions. TFDD's are older than OO
- facilities in TP, so they do not directly allow for object implementation. But,
- simply by using User Data as it's intended to be used, they can integrate quite
- well with objects. Both KbdEdit and StrWrite use the Self pointer, and in
- KbdEdit the tfdd's work is actually done by a class method.
- Each of the three descendant units automatically initializes one instance of
- the class it defines, as part of its unit initialization code. In the case
- KbdEdit and WritAttr, it's hard to imagine why you'd need more than one
- instance of the class. But for StrWrite you might. All you'd have to do is
- declare
- VAR otherStr: strWriteC;
- then call
- otherStr.init;
- KbdEdit and WritAttr use TP's Crt unit. Take care to replace the mention, in
- the implementation Uses lists, with OpCrt or TpCrt if you use those.
-
-
- Copyright notice:
- I claim copyright on this file and the four source files mentioned.
- These units are not put into the public domain, so as to prevent the
- diffusion of half-modified versions. The source code may be distributed by any
- means in complete form and as is, including the present notice, or not at all.
- Modifications, etc. may be ADDED to the distributed code, as separate texts, of
- course.
- As author and copyright owner I waive all legal rights on object or
- executable code compiled using part or all of these units. This is to avoid any
- administrative complication for users.
- However, I request that any programmer using this source code for paid work
- or for sold programs send me a $5 contribution at:
- Philippe Ranger
- P. O. Box 48017
- 5678 Park Avenue
- Montreal QC H2V 4S8
- Canada
-
- Comments would be much appreciated. My CompuServe user ID is 71531,1350.
-
- Philippe Ranger
- July 13, 1990
-
- ----------------end-of-author's-documentation---------------
-
- Software Library Information:
-
- This disk copy provided as a service of
-
- The Public (Software) Library
-
- We are not the authors of this program, nor are we associated
- with the author in any way other than as a distributor of the
- program in accordance with the author's terms of distribution.
-
- Please direct shareware payments and specific questions about
- this program to the author of the program, whose name appears
- elsewhere in this documentation. If you have trouble getting
- in touch with the author, we will do whatever we can to help
- you with your questions. All programs have been tested and do
- run. To report problems, please use the form that is in the
- file PROBLEM.DOC on many of our disks or in other written for-
- mat with screen printouts, if possible. The P(s)L cannot de-
- bug programs over the telephone.
-
- Disks in the P(s)L are updated monthly, so if you did not get
- this disk directly from the P(s)L, you should be aware that
- the files in this set may no longer be the current versions.
-
- For a copy of the latest monthly software library newsletter
- and a list of the 2,000+ disks in the library, call or write
-
- The Public (Software) Library
- P.O.Box 35705
- Houston, TX 77235-5705
- (713) 524-6394
-